package cn.like.backEnd.biz.mapper;

import cn.like.base.BaseMapper;
import cn.like.entity.AuthResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 资源(AuthResource)表数据库访问层
 *
 * @author like
 * @since 2021-07-08 15:33:08
 */
@Mapper
public interface AuthResourceMapper extends BaseMapper<AuthResource> {

    /**
     * desc: 通过用户id找到资源的代码 <br>
     * details: 根据用户id查询到对应角role_id，然后在auth_role_authority找到对应type是RESOURCE以及role_id相等的
     *
     * @param userId auth user id
     * @return: {@link List<String> }
     * @author: like 980650920@qq.com
     * @date 2021-07-10 09:05:38
     */
    List<String> findResourceCodeByUserId(@Param("userId") Object userId);
}